/*
* @Date: 2021/3/28
* @Author: XueChengwu <xuechengwu@erayt.com>
* @Copyright: 2015-2019 Erayt, Inc.
* @Description: If you have some questions, please contact: xuechengwu@erayt.com.
*/
import React from 'react';
import './index.scss';
import Icon from '@/components/Icon';

export default class extends React.Component {
  onEdit = () => {
    const { shortcode } = this.props;
    window.location.href = `/front/project?c=${shortcode}`;
  }

  render() {
    const { id = '', name = '', addtime = '', description } = this.props;
    return (
      <div className="project-item-box">
        <div className="project-item-title">
          { name }
        </div>
        <div className="project-item-description">
          { description }
        </div>
        <div className="project-item-footer">
          <div className="project-item-addtime">{ addtime }</div>
          <div>
            <Icon type="edit" onClick={this.onEdit}/>
            <Icon type="trash" />
          </div>
        </div>
      </div>
    )
  }
}
